package com.study.zzedu.fragment.tab.catalog;


import android.content.Context;

import com.study.zzedu.base.BasePresenter;
import com.study.zzedu.http.OnResultListener;

public class CatalogPresenter extends BasePresenter<CatalogContract.IView> {

    private CatalogModel pwdModel;

    public CatalogPresenter() {
        this.pwdModel = new CatalogModel();
    }

    public void getCourseContent(Context context,String courseCode) {
        pwdModel.getCourseContent(context,courseCode, new OnResultListener() {
            @Override
            public void onSuccess(String result) {
                getView().getCourseContentData(result);
            }

            @Override
            public void onError(String error) {
                //getView().getData(result);
            }
        });
    }

    public void getVideoURL(Context context,String id) {
        pwdModel.getVideoURL(context,id, new OnResultListener() {
            @Override
            public void onSuccess(String result) {
                getView().getURLReturn(result);
            }

            @Override
            public void onError(String error) {
                getView().showError(error);
            }
        });
    }
}
